def test(str):
    ret=str
    min_count=len(str)
    for i in set(str):
        if str.count(i)<min_count:
            min_count=str.count(i)

    for i in ret:
        if ret.count(i)==min_count:
            ret=ret.replace(i,'')
    print(ret)


if __name__=="__main__":
    test('abccddc')
    test('jkhgFGHSDOIFH')
    test('AaAaBbBbCcCCcabcdef')